home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 4 / Mac Giga-ROM 4.0 - 1993.toast / FILES / HYP / C-D / DiskManager2.cpt / DiskManager 2.0 / background_2906.txt < prev    next >
Text File  |  1989-02-26  |  3KB  |  110 lines

  1. -- background: 2906 from stack: in.0
  2. -- bmap block id: 4829
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on newStack
  8.   extend
  9. end newStack
  10.  
  11. on extend
  12.   -- type "extend" into the message box and press return to make
  13.   -- three months worth of new cards.
  14.   if the name of this stack contains "stack ideas"
  15.   then
  16.   answer "Please make a new stack before extending it." with "OK"
  17. else
  18.   answer "Make three months more of new cards?" with "OK" or "Cancel"
  19.   if it is "Cancel" then exit extend
  20.   go to last card of this background
  21.   put getStartDate() into start      --what date to begin on
  22.   if start is "Cancel" then exit extend
  23.   put 60*60*24 into OneDay      --seconds in a day
  24.   repeat with cnt = 1 to (365 div 4)   --three months
  25.     put start into it        --a copy
  26.     convert it to long date
  27.     put it into field "Date"
  28.     add OneDay to start
  29.     doMenu New Card
  30.   end repeat
  31.   convert start to long date     --fix the last card
  32.   put start into field "Date"
  33. end if
  34. end extend
  35.  
  36. function getStartDate
  37. -- end of stack or today, whichever is newer
  38. get field "Date"
  39. if it is empty then put the short date into it
  40. convert it to seconds    --so we can compare
  41. put the short date into today
  42. convert today to seconds
  43. if today < 2587766400 then
  44.   answer "Set the Control Panel to today's date" with "OK"
  45.   return "Cancel"
  46. end if
  47. if it >= today then return it   --calendar already beyond today
  48. convert it to short date
  49. answer "Start from which date?" with it or the short date or "Cancel"
  50. if it is "Cancel" then return it
  51. convert it to seconds
  52. return it
  53. end getStartDate
  54.  
  55. on openBackground
  56.   push recent card
  57. end openBackground
  58.  
  59.  
  60. -- part 93 (field)
  61. -- low flags: 01
  62. -- high flags: 0007
  63. -- rect: left=50 top=33 right=342 bottom=512
  64. -- title width / last selected line: 0
  65. -- icon id / first selected line: 0 / 0
  66. -- text alignment: 0
  67. -- font id: 3
  68. -- text size: 12
  69. -- style flags: 0
  70. -- line height: 16
  71. -- part name: 
  72.  
  73.  
  74. -- part 94 (button)
  75. -- low flags: 00
  76. -- high flags: 8004
  77. -- rect: left=6 top=131 right=161 bottom=47
  78. -- title width / last selected line: 0
  79. -- icon id / first selected line: 0 / 0
  80. -- text alignment: 1
  81. -- font id: 0
  82. -- text size: 12
  83. -- style flags: 0
  84. -- line height: 16
  85. -- part name: Back
  86. ----- HyperTalk script -----
  87. on mouseUp
  88.   go to card id 12441
  89. end mouseUp
  90.  
  91.  
  92.  
  93. -- part 95 (button)
  94. -- low flags: 00
  95. -- high flags: 8004
  96. -- rect: left=6 top=174 right=203 bottom=48
  97. -- title width / last selected line: 0
  98. -- icon id / first selected line: 0 / 0
  99. -- text alignment: 1
  100. -- font id: 0
  101. -- text size: 12
  102. -- style flags: 0
  103. -- line height: 16
  104. -- part name: MORE
  105. ----- HyperTalk script -----
  106. on mouseUp
  107.   go to card id 11209
  108. end mouseUp
  109.  
  110.